Medical devices, such as cardiac pacemakers, cardiac defibrillators, or implantable cardioverter-defibrillators, provide therapeutic electrical stimulation to a heart of a patient via electrodes carried by one or more medical leads and/or electrodes on a housing of the medical device. The electrical stimulation may include signals such as pulses or shocks for pacing, cardioversion or defibrillation. In some cases, a medical device may sense intrinsic depolarizations of the heart, and control delivery of stimulation signals to the heart based on the sensed depolarizations. Upon detection of an abnormal rhythm, such as bradycardia, tachycardia or fibrillation, an appropriate electrical stimulation signal or signals may be delivered to restore or maintain a more normal rhythm of the heart. For example, in some cases, an implantable medical device (IMD) or an external medical device may deliver pacing pulses to the heart of the patient upon detecting tachycardia or bradycardia or deliver cardioversion or defibrillation shocks to the heart upon detecting tachycardia or fibrillation.